<?php
// +----------------------------------------------------------------------
// | QSCMS
// +----------------------------------------------------------------------
// | Copyright (c)  2025 https://www.qqss.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed QSCMS is not free software, commercial use must purchase official license from official website to avoid unnecessary legal disputes.
// +----------------------------------------------------------------------
// | Author: Contract 990504246@qq.com
// +----------------------------------------------------------------------

namespace app\adminapi\controller;

use app\common\util\RoleAuth;

class User extends Base
{
    /**
     * User information and permissions
     * @auth false
     */
    public function getAdminUserInfo(RoleAuth $roleAuth)
    {
        $perms = $roleAuth->getUserPerms($this->user);

        $this->success('', [
            'user'  => $this->user,
            'perms' => $perms,
        ]);
    }

    /**
     * Route menu
     * @auth false
     */
    public function getAdminUserMenu(RoleAuth $roleAuth)
    {
        $menu = $roleAuth->getUserMenu($this->user);
        $this->success('', $menu);
    }
}
